from redis import  StrictRedis


class Config(object):
    DEBUG = True
    SQLALCHEMY_BINDS = "mysql://root:123@127.0.0.1:3306/news_it03"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    SECRET_KEY = "SADQWDASAWEF"
    SESSION_TYPE = "redis"
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    SESSION_PERMANENT = 60 * 60 * 24

class DevelopmentConfig(Config):
    pass#开发环境，基本的cofig配置，很类似于开发环境

class ProductionConfig(Config):
    DEBUG = False
    SQLALCHEMY_BINDS = "mysql://root:123@127.0.0.1:3306/production_data"
    pass#生产环境

class TestConfig(Config):
    pass#测试环境

configs={
    "dev":DevelopmentConfig,
    "pro":ProductionConfig,
    "tes":TestConfig
}



